enum Role{
    SUPER_ADMIN,
    ADMIN,
    USER
}
console.log(Role.ADMIN)

enum Role2{
    SUPER_ADMIN,
    ADMIN=3,
    USER
}
console.log(Role2[0])
console.log(Role2[3])
console.log(Role2[4])

//枚举既可以作为值，也可以作为类型
enum Role3{
    SUPER_ADMIN = 'SUPER_ADMIN',
    ADMIN = 'ADMIN',
    USER = 'USER'
}

let a:Role3.USER = Role3.USER;

const enum Roles{
    SUPER_ADMIN = 'SUPER_ADMIN',
    ADMIN = 'ADMIN',
    USER = 'USER'
}

//error枚举只是只读
//Roles.SUPER_ADMIN = 'SUPER_ADMIN';